package com.lu.netty.io.core

import android.util.Log

object NettyLog {
    private const val TAG = "Netty"

    fun t(tag: String, log: String) {
        if (NettyConfigure.logLevel >= 4) {
            Log.println(Log.VERBOSE, TAG, "$tag==$log")
        }
    }

    fun d(tag: String, log: String) {
        if (NettyConfigure.logLevel >= 3) {
            Log.d(TAG, "$tag==$log")
        }
    }

    fun i(tag: String, log: String) {
        if (NettyConfigure.logLevel >= 2) {
            Log.i(TAG, "$tag==$log")
        }
    }

    fun w(tag: String, log: String, throwable: Throwable? = null) {
        if (NettyConfigure.logLevel >= 1) {
            Log.w(TAG, "$tag==$log", throwable)
        }
    }

    fun e(tag: String, log: String, throwable: Throwable? = null) {
        if (NettyConfigure.logLevel >= 0) {
            Log.e(TAG, "$tag==$log", throwable)
        }
    }
}